<?php
include_once 'daos/mysqlConection.php';
//include_once 'mysqlConection.php';
class AdministradorDao extends mysqlConection{
	public function autenticarUsuario($nick,$pass){
		if(!(empty($nick))&&!(empty($pass))){
			$cad_hash=hash('whirlpool',$pass); // string de 128 caracteres 
			$cad_sql="select * from usuario where nick_usuario='".$nick."' and pass_usuario='".$cad_hash."'";
			try	{
				$resulset=$this->ejecutarQuery($cad_sql);
				$fila = mysql_fetch_array($resulset);
				return $fila;
			}
			catch (Exception $e){
				// AUN NO SE DEFINE COMO MANEJAR LOS ERRORES
			}
		}
		return null;
	}
}
//$p = new AdministradorDao();
//echo sizeof($p->autenticarUsuario('prueba', 'a3696038ceffb0d2f9f2c058950bcc6d79fd5dfce0eec32bfd81a133b9b1ae03263dff895267b3d53ea6b4e1a0c022d046853a5a7e1fa6cae32ad0aa3e71611e'))."\n";
?>
